<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>

    // do..while语法结构
    // do {

    // } while (条件)

    // 练习一: 打印10次Hello World
    var count = 0
    do {
      console.log("Hello World")
      count++
    } while (count < 10)

    // 练习二: 计算0~99的数字和
    var count = 0
    var totalCount = 0
    do {
      totalCount += count
      count++
    } while (count < 100)
    console.log("totalCount:", totalCount)

  </script>

</body>
</html>